package com.cheejee.goodscenter.dao;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.cheejee.goodscenter.module.entity.Sku;

@Mapper
public interface SkuMapper {

	int deleteByPrimaryKey(Long id);

//	int insert(Sku record);

	int insertSelective(Sku record);

	Sku selectByPrimaryKey(Long id);

	int updateByPrimaryKeySelective(Sku record);

//	int updateByPrimaryKeyWithBLOBs(Sku record);

//	int updateByPrimaryKey(Sku record);

	// ################ 以上为mybatis generator生成 #####################

	/**
	 *
	 * @param goodsId
	 * @param goodsSpecificIdGroup
	 * @param isOn
	 * @return
	 */
	List<Sku> selectBySelective(@Param("goodsId")Long goodsId, @Param("goodsSpecificIdGroup")String goodsSpecificIdGroup, @Param("isOn")Boolean isOn);
	
	int selectSpecificGroupCount(@Param("goodsId")Long goodsId, @Param("goodsSpecificIdGroup")String goodsSpecificIdGroup);
	
	int selectVersion(Long id);

	/**
	 *
	 * @param sku
	 * @return
	 */
	int insertMany(@Param("sku")List<Sku> sku);

	/**
	 *
	 * @param goodsId
	 */
	int deleteByGoodsId(Long goodsId);

	/**
	 *
	 * @param id
	 * @return
	 */
	int deleteById(@Param("id")Long[] id);
	
	/**
	 * 检查是否有SKU使用了某个规格
	 *
	 * @param specificId
	 * @return
	 */
	int checkUseSpecific(String specificId);
}